<% title "All #{@repository.full_name} tags - Libraries.io" %>

<h1><%= link_to @repository.full_name, repository_path(@repository.to_param) %> tags</h1>
<hr>
<div class="row">
  <div class="col-sm-8">
    <% if @tags.any? %>
    <table class='table'>
      <% @tags.each do |tag| %>
      <tr>
        <td>
          <%= link_to tag, tag.repository_url %>
        </td>
        <% if tag.published_at.present? %>
          <td>
            <small class='text-muted'>
              <%= tag.published_at.to_fs(:long_ordinal) %>
            </small>
          </td>
        <% end %>
        <td>
          <small class='text-muted'>
            <%= link_to tag.repository_url do %>
              <%= fa_icon('tag') %>
              Browse source on <%= tag.repository.host_type %>
            <% end %>
          </small>
        </td>
        <td>
          <% if tag.previous_tag %>
            <small class='text-muted'>
              <%= link_to tag.diff_url do %>
                <%= fa_icon('random') %>
                View diff between <%= tag %> and <%= tag.previous_tag %>
              <% end %>
            </small>
          <% end %>
        </td>
      </tr>
      <% end %>
    </table>
      <%= will_paginate @tags, page_links: false %>
    <% else %>
      <p>
        No tags found, go back to <%= link_to @repository.full_name, repository_path(@repository.to_param) %>.
      </p>
    <% end %>
  </div>
  <div class="col-sm-4">

  </div>
</div>
